Skip to content

Convert forever-ui to a Kotlin Multiplatform module - #3367

Closed
StylianosGakis wants to merge 2 commits into
developfrom
refactor/kmp-forever-ui
Closed

StylianosGakis wants to merge 2 commits into
developfrom
refactor/kmp-forever-ui

Conversation

@StylianosGakis

Copy link
Copy Markdown
Member
🤖 AI description

Turns forever-ui into a Kotlin Multiplatform module (JVM and Android targets) with its screen, ViewModel and Apollo operations in commonMain. Part of making the whole app run on a second platform (desktop), and it unblocks converting feature-forever and feature-onboarding.

Nothing changes on Android. The two things that needed Android, the share sheet and copying the referral code to the clipboard, sit behind two small module-local expect functions whose Android side is the previous code moved, not rewritten.

The one swap worth a look: android.net.Uri.encode becomes com.eygraber.uri.Uri.encode (already used elsewhere in commonMain). A new test pins the exact encodings so the referral share URL cannot drift.

The first commit is 16 pure renames, review the second.

Pure rename so history follows the files. The build file still points at
src/main and is rewritten in the next commit.
The module now builds for JVM and Android with its code in commonMain.
Sharing the referral link and copying the referral code go through two
module-local expect functions. The Android actuals keep the existing
Intent chooser and ClipboardManager code; the JVM actuals put the text on
the system clipboard. The referral code is percent-encoded with uri-kmp's
Uri.encode, a port of Android's codec, which a jvmTest pins against the
values android.net.Uri.encode produces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant